import React from "react";
import { Component } from "react";
import { observer } from "mobx-react";
import { observable } from "mobx";
import AddCount from "./compontents/AddCount";
import BddNum from "./compontents/BddNum";
import { Language } from "../../../../i18n/Language";
export interface MobxProps {}

export interface MobxState {}
// const AaaState = observable({
//   count: 0,
//   increment: function () {
//     this.count--;
//   },
//   decrement: function () {
//     this.count++;
//   },
// });

/* 观察状态改变的函数 */

@observer
class Mobx extends Component<MobxProps, MobxState> {
  @observable public AaaState = {
    count: 0,
    increment: () => {
      this.AaaState.count--;
    },
    decrement: () => {
      this.AaaState.count++;
    },
  };

  render() {
    return (
      <>
        <AddCount store={this.AaaState} />
        <BddNum />
        {Language.controls.newButtonTooltip}
      </>
    );
  }
  componentDidMount() {}
}

export default Mobx;
